﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace L09
{
    class Dictionary
    {
        static void Main(string[] args)
        {
            Dictionary<string, string> dicl = new Dictionary<string, string>();
            dicl.Add("Green", "绿色");
            dicl.Add("Blue", "蓝色");
            dicl.Add("Yellow", "黄色");
            dicl.Add("Red", "红色");
            dicl.Add("Brown", "棕色");
            if (dicl.ContainsKey("Green"))
            {
                Console.WriteLine("Key:{0},Value:{1}", "Green", dicl["Green"]);
            }
            Console.WriteLine();
            Console.WriteLine();
            foreach (string item in dicl.Values)//输出value
            {
                Console.WriteLine(item);
            }
            Tuple<string, string> a = new Tuple<string, string>("第一站", "第二站");
            Tuple<string, string> b = new Tuple<string, string>("第二站", "第三站");
            Dictionary<int, Tuple<string, string>> dic2 = new Dictionary<int, Tuple<string, string>>();
            dic2.Add(1, a);
            dic2.Add(2, b);
            if (dic2.ContainsKey(1))
            {
                Console.WriteLine("Key:{0},Value:{1}", 1, dic2[1]);
            }
            foreach (Tuple<string, string> item in dic2.Values)//输出value
            {
                Console.WriteLine(item);
            }
            Console.ReadKey();
        }
        private Tuple<string, string> Divide(string v1, string v2)
        {
            string a = v1;
            string b = v2;
            return Tuple.Create<string, string>(a, b);
        }
    }

}



